package com.grape.dp.decorator;
/**
 * 描述:FactoryGateway
 * @author: myx
 * @date: 2019/7/24 0024
 * Copyright © 2019-grape. All rights reserved.
 */
public class FactoryGateway {

//    public static GatewayComponent getComponentGateway() {
//        LimitDecorator limitDecorator = new LimitDecorator();
//        LogDecorator logDecorator = new LogDecorator();
//        limitDecorator.setComponentGateway(logDecorator);
//        logDecorator.setComponentGateway(new BasicComponentGateway());
//        return limitDecorator;
//    }
    public static GatewayComponent getComponentGateway() {
        return new LimitDecorator(new LogDecorator(new BasicComponentGateway()));
    }

    public static void main(String[] args) {
        FactoryGateway.getComponentGateway().service();
    }
}